package com.chentu.aliyun.oss.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Author: LiZhong Wang
 * <p> DateTime: 2024/9/24 10:01
 * <p> Description:
 * <p>
 **/
@ConfigurationProperties(prefix = "aliyun.oss")
public class OssProperties {
	
	
	/**
	 * 阿里云OSS Endpoint
	 */
	private String endpoint;
	
	/**
	 * 阿里云OSS Bucket名称
	 */
	private String bucketName;
	
	/**
	 * 阿里云OSS AccessKeyId
	 */
	private String accessKey;
	
	/**
	 * 阿里云OSS AccessKeySecret
	 */
	private String secretKey;
	

	// ===================  以下有默认值  ======================
	/**
	 * 注册域名,与域名一一对应,[选填]
	 */
	private String region ;
	
	/**
	 * HTTP header User-Agent
	 */
	private String userAgent="aliyun-sdk-java";
	
	/**
	 * Socket 链接超时时间
	 */
	private Integer socketTimeout = 50000;
	
	/**
	 * 建立连接超时时间
	 */
	private Integer connectionTimeout = 50000;
	
	/**
	 * 空闲连接超时时间
	 */
	private Integer idleConnectionTime = 60000;
	
	/**
	 * 错误重试次数
	 */
	private Integer maxErrorRetry =3;
	
	/**
	 * 是否支持CNAME
	 */
	private Boolean supportCname = false;
	
	/**
	 * 是否开启SSL
	 */
	private Boolean verifySSLEnable = true;
	
	/**
	 * 最大连接数
	 */
	private Integer maxConnections  =1024;
	
	public String getEndpoint() {
		return endpoint;
	}
	
	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}
	
	public String getBucketName() {
		return bucketName;
	}
	
	public void setBucketName(String bucketName) {
		this.bucketName = bucketName;
	}
	
	public String getAccessKey() {
		return accessKey;
	}
	
	public void setAccessKey(String accessKey) {
		this.accessKey = accessKey;
	}
	
	public String getSecretKey() {
		return secretKey;
	}
	
	public void setSecretKey(String secretKey) {
		this.secretKey = secretKey;
	}
	
	public String getRegion() {
		return region;
	}
	
	public void setRegion(String region) {
		this.region = region;
	}
	
	public String getUserAgent() {
		return userAgent;
	}
	
	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}
	
	public Integer getSocketTimeout() {
		return socketTimeout;
	}
	
	public void setSocketTimeout(Integer socketTimeout) {
		this.socketTimeout = socketTimeout;
	}
	
	public Integer getConnectionTimeout() {
		return connectionTimeout;
	}
	
	public void setConnectionTimeout(Integer connectionTimeout) {
		this.connectionTimeout = connectionTimeout;
	}
	
	public Integer getIdleConnectionTime() {
		return idleConnectionTime;
	}
	
	public void setIdleConnectionTime(Integer idleConnectionTime) {
		this.idleConnectionTime = idleConnectionTime;
	}
	
	public Integer getMaxErrorRetry() {
		return maxErrorRetry;
	}
	
	public void setMaxErrorRetry(Integer maxErrorRetry) {
		this.maxErrorRetry = maxErrorRetry;
	}
	
	public Boolean getSupportCname() {
		return supportCname;
	}
	
	public void setSupportCname(Boolean supportCname) {
		this.supportCname = supportCname;
	}
	
	public Boolean getVerifySSLEnable() {
		return verifySSLEnable;
	}
	
	public void setVerifySSLEnable(Boolean verifySSLEnable) {
		this.verifySSLEnable = verifySSLEnable;
	}
	
	public Integer getMaxConnections() {
		return maxConnections;
	}
	
	public void setMaxConnections(Integer maxConnections) {
		this.maxConnections = maxConnections;
	}
}
